var strStr = function(haystack, needle) {
  if(!needle.length) return 0
  let left = 0
  let right = needle.length - left
  while(right <= haystack.length) {
    console.log(haystack.substring(left,right));
    if(haystack.substring(left,right) == needle) {
          return left
      }
      left++
      right++
  }
  return -1
};
console.log(strStr('hello','ll'));